package thread;

/**
 * Created with IntelliJ IDEA.
 * Description:
 * User: 25397
 * Date: 2022-03-29
 * Time: 17:57
 */
public class Demo17 {
    public static void main(String[] args) throws InterruptedException {
        Object object=new Object();
        synchronized (object){//wait等哪个对象，就对哪个对象加锁
            System.out.println("wait前");
            object.wait();
            System.out.println("wait后");
        }
    }
}
